using System;
using System.Collections.Generic;
using System.Text;
using Microsoft.Xna.Framework;
using Xfinity.Engine;
using Microsoft.Xna.Framework.Graphics;
using Xfinity.Player;

namespace Xfinity.HUD
{
    public class HeadsUpDisplayComponent : DrawableGameComponent
    {
        //List<Texture2D> hudBackgrounds;
        public HeadsUpDisplayComponent()
            : this(GameManager.Game)
        {

        }

        public HeadsUpDisplayComponent(Game game)
            : base(game)
        {

        }

        protected override void LoadGraphicsContent(bool loadAllContent)
        {
            if (loadAllContent)
            {
                //Load the HUD resources here.
            }

            base.LoadGraphicsContent(loadAllContent);
        }


        public override void Draw(GameTime gameTime)
        {
            string text = GameManager.PlayerManager.Player.Health.ToString();
            Vector2 size = GraphicsHelper.DefaultFont.MeasureString(GameManager.PlayerManager.Player.Health.ToString());
            Vector2 pos = new Vector2(
                GraphicsHelper.GraphicsDevice.Viewport.Width-size.X-3,
                GraphicsHelper.GraphicsDevice.Viewport.Height-size.Y-3);
            GraphicsHelper.DrawText(text,pos,Color.Purple);
            
            base.Draw(gameTime);
        }


    }
}
